﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Public;

namespace DAL
{
    public class ThietLapDAL
    {
        public static void InsertThietLap(ThietLapPublic _tl)
        {
            ThietLap tl = new ThietLap();
            tl.MaPX = _tl.MaPX;
            tl.MaQH = _tl.MaQH;
            //tl.MaT = _tl.MaT;
            Common.db.AddToThietLaps(tl);
            Common.db.SaveChanges();
        }
        public static ThietLapPublic LoadThietLap()
        {
            var thietlap = Common.db.ExecuteStoreQuery<ThietLapPublic>(@"select * from ThietLap");
            return thietlap.ToList()[0];
        }
    }
}
